<?php /* Smarty version 2.6.18, created on 2008-06-12 23:40:10
         compiled from admin/Websetup_usergroup.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'get_app_inf', 'admin/Websetup_usergroup.html', 4, false),array('function', 'webcontrol', 'admin/Websetup_usergroup.html', 156, false),)), $this); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">  
<head>  
<title><?php echo $this->_plugins['function']['get_app_inf'][0][0]->_pi_func_get_app_inf(array('key' => 'siteName'), $this);?>
 - <?php echo $this->_tpl_vars['title']; ?>
</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />  
<!-- add your meta tags here -->  
  
<link href="css/my_layout.css" rel="stylesheet" type="text/css" />
<link href="css/screen/usergroup.css" rel="stylesheet" type="text/css" />  
<!--[if lte IE 7]>  
<link href="css/my_patches/patch_my_layout.css" rel="stylesheet" type="text/css" />  
<![endif]-->  
<script type="text/javascript" src="script/jquery.js"><!-- jQuery 1.2.1 --></script>
<script type="text/javascript" src="script/jquery.form.js"><!-- 表单Ajax插件 --></script>
<script type="text/javascript" src="script/yav.js"><!-- 表单验证插件 --></script>
<script type="text/javascript" src="script/jquery.yav.pack.js"><!-- 表单验证插件 --></script>
<script type="text/javascript" src="script/jquery.confirm.js"><!-- 对话框插件 --></script>

<script type="text/javascript">


// 在网页载入时加载
$(function() {

	// ugList表格在鼠标悬停状态变更背景色
	$("#ugList tr").hover(function() {
		$(this).addClass("OMover");
	},function(){
		$(this).removeClass("OMover");
	});

	// 用yav校验#formModifyUserGroup的字段
	$("#formModifyUserGroup").yav();
	$("#formAddUserGroup").yav();
	
	// 绑定'删除'链接的点击ajax事件
	$('.removeUserGroup').click(function() {
		$.get("websetup.php", {
			controller : 'admin_usergroup',
			action	   : 'removeUserGroup',
			id         : $(this).attr("id")
		 },function(data){
		 	if(data){
		 		location.reload();
		 	}else{
		 		alert('不能删除非空目录！');
		 	}
		 }
		);
	});

	// 显示confirm对话框
	$('.removeUserGroup').confirm({
		msg:'<img src="images/notice.gif" /> ',
		stopAfter:'ok',
		eventType:'click',
		timeout:3000,
		buttons: {
			ok:'确认',
			cancel:'取消',
			separator:' | '
		}
	});
	
	//绑定修改表单中下拉列表框的click事件，当点击时从服务器ajax方式获得不包含当前节点树的option列表
	$("#select_fclass").click(function() {
		
		//在下拉框为空的情况下才通过ajax获取数据
		if(!$(this).html()) {
			$.get("websetup.php", {
				controller : 'admin_usergroup',
				action     : 'ajaxtree',
				id         : $("#user_group_id").attr("value")
			},function(response){
				list = eval('(' + response + ')');
				$("#select_fclass").append("<option value='0'>根目录</option>");
				$.each(list, function(i,value){
					$("#select_fclass").append("<option value='" + value.user_group_id + "'>" + 
												value.levelstr + value.group_name + "</option>");
				});
			});
		}

		
	});

	//绑定添加链接的click事件
	$(".ugAdd").click(function() {
	
		//先删除已经存在的表单
		_removeModifyForm();
		
		//给表格添加一行
		$("#tr_" + $(this).attr("href")).after( "<tr class='ugModifyform'><td colspan='5'>" + "</td></tr>" );
		$(".ugModifyform td").css("background","#FFF url(images/add.gif) no-repeat top left");
		$("#formAddUserGroup").appendTo(".ugModifyform td");
		
		//预填写表单
		$("#parent_id").val($(this).attr("href"));
		
		return false;
	
	});
	
	
	// 绑定链接被click
	$(".band").click(function(){
		location.replace("websetup.php?controller=admin_usergroup&action=band&user_group_id=" + $(this).attr("user_group_id"));
	});
	
});

// 修改用户组表单显示及预填写
function ugModify($id, $groupname, $description) {	

	// 删除已存在的修改表单
	_removeModifyForm();
	
	// 点击修改链接时在当前tr后面插入修改表单
	$("#tr_" + $id).after( "<tr class='ugModifyform'><td colspan='5'>" + "</td></tr>" );
	$("#formModifyUserGroup").appendTo(".ugModifyform td");
	
	// 预填写表单
	$("#user_group_id").val($id);
	$("#group_name").val($groupname);
	$("#description").val($description);
	
}

// 删除已存在的修改表单
function _removeModifyForm() {
	$("#formAddUserGroup").appendTo("#formModifyUserGroupBox");
	$("#formModifyUserGroup").appendTo("#formModifyUserGroupBox");
	$("#select_fclass").empty();
	$("#ugList .ugModifyform").remove();
}
</script>

</head>  


<body> 
  <div id="page_margins">

    <div id="border-top">
      <div id="edge-tl"></div>
      <div id="edge-tr"></div>
    </div>
    <div id="page">
      <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/Websetup_header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
      <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/Websetup_nav.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

      <div id="main">
        <div id="col1">
          <div id="col1_content" class="clearfix">
				<?php echo $this->_plugins['function']['webcontrol'][0][0]->_pi_func_webcontrol(array('type' => 'menu','name' => 'myMenu'), $this);?>

          </div>
        </div>
        <div id="col3">
          <div id="col3_content" class="clearfix">
            
				<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/Websetup_usergroup_list.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
            
          </div>
          <!-- IE Column Clearing -->
          <div id="ie_clearing"> &#160; </div>
        </div>
      </div>
      <!-- begin: #footer -->
      <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/Websetup_footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
    </div>
    <div id="border-bottom">
      <div id="edge-bl"></div>
      <div id="edge-br"></div>
    </div>
  </div>
</body>
</html>